﻿using UnityEngine;
using TinyWnd;

public class WLevelTemp : MonoBehaviour
{
    UILabel label;

    int _id;

    void Awake()
    {
        var tran = transform;
        label = Utility.FindChild<UILabel>(tran, "Label");

        UIEventListener.Get(gameObject).onClick = delegate
        {
            ClickLevel();
        };
    }

    public void InitLevel(int id)
    {
        _id = id;
        label.text = string.Format("level:{0}", _id);
    }

    void ClickLevel()
    {
        var content = new WndLevelDetaiContent();
        content.id = _id;
        content.desc = "Be a brave solider BB";
        WndMgr.inst.ShowWindow(WndId.levelDetail, content);
    }
}
